import {BSAE_URL} from './https.js'

export default function(url,method="GET",data){
	return new Promise((resolve,reject)=>{
		uni.request({
			url:BSAE_URL+url,
			method,
			data,
			success(res) {
				if(res.statusCode===200 && res.data){
					resolve(res.data)
				}else{
					reject(res)
				}
			},
			fail(err) {
				reject(err)
			}
		})
	})
}